package net.homelinux.ajay.net.ondisk.client.util;

import com.google.gwt.user.client.rpc.AsyncCallback;

public class GSpreadSheet extends GData{
  
  public static GSpreadSheet attachSheet(String docid, String sheetid){
    
    GSpreadSheet sheet = new GSpreadSheet(docid, sheetid);
    return sheet;
  }


  public static GSpreadSheet attachSheet(String docid, String sheetid, boolean webauthenticate, String usr, String pwd) {
    GSpreadSheet sheet = new GSpreadSheet(docid, sheetid,webauthenticate,usr,pwd);
    return sheet;
  }

  private String docid;
  private String sheetid;

  private GSpreadSheet(String docid, String sheetid) {
    this.docid = docid;
    this.sheetid = sheetid;
  }


  public GSpreadSheet(String docid, String sheetid, boolean webauthenticate, String usr, String pwd) {
    this(docid,sheetid);
    this.authenticateWeb(usr,pwd);
  }

  public void authenticateWeb(String usr, String pwd) {
    // TODO Auto-generated method stub
    
  }
//  
//  public void getSpreadsheets(String feedUrl, final AsyncCallback
//      asyncCallback) {
//
//          JSONRequest.asyncJsonRequest(feedUrl, new JsonResponseHandler() {
//            public void onSuccess(JSONObject obj) {
//              displaySpreadsheetsInfo(obj, asyncCallback);
//            }
//          });
//
//        }
//
//        private void displaySpreadsheetsInfo(JSONObject jsonDoc,
//      AsyncCallback asyncCallback) {
//       JSONArray jspeadsheets =
//      jsonDoc.get("feed").isObject().get("entry").isArray();
//      ...
//      your code
//      ...
//
//      }
//
  
}
